// pages/operations/operations.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    scrollTop: 0,
    navList: [{
        title: "物流线路管理",
        img: "/img/nav1.png",
        url: '/pages/circuitManagement/circuitManagement'
      },
      {
        title: "托运单管理",
        img: "/img/nav2.png",
        url: '/pages/consignmentManagement/consignmentManagement'
      },
      {
        title: "运营数据检索",
        img: "/img/nav3.png",
        url: '/pages/pickupcheck/pickupcheck'
      }
    ],
    active: ''
  },
  toRoute(e) {
    console.log(e, 'sssss')
    let {
      url_path
    } = e.currentTarget.dataset || {};
    wx.navigateTo({
      url: url_path,
    })
    
  },
  onChange(event) {
    wx.switchTab({
      url: event.detail == 0 ? '/pages/index/index' : '/pages/userCenter/userCenter',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let user_infos = wx.getStorageSync('user_infos');
    let company_type = user_infos.company_type;
    if(company_type && this.data.navList.length == 3){      //快递企业不展示物流线路管理 和 运营数据
        this.setData({
          navList: [{
            title: "运营数据检索",
            img: "/img/nav3.png",
            url: '/pages/pickupcheck/pickupcheck'
          }]
        });
    }

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {
    wx.reLaunch({
      url: '/pages/index/index',
    })
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})